//
//  SingerMusicListModel.m
//  YanMusicPlayer
//
//  Created by 1564335 on 15-6-12.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "SingerMusicListModel.h"

@implementation SingerMusicListModel

- (instancetype)initWithDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        if (dic[@"song_name"] != nil && ![dic[@"song_name"] isEqual:[NSNull null]] && ![dic[@"song_name"] isEqualToString:@""]) {
            self.song_id = dic[@"song_id"];
            if (dic[@"singer_id"] == nil || [dic[@"singer_id"] isEqual:[NSNull null]]) {
                _singer_id = nil;
            } else {
                self.singer_id = dic[@"singer_id"];
            }
            self.song_name = dic[@"song_name"];
            self.singer_name = dic[@"singer_name"];
            // 音乐
            NSArray *array1 = dic[@"url_list"];
            if (array1 != nil && ![array1 isEqual:[NSNull null]]) {
                NSDictionary *auditionDic = nil;
                    auditionDic = [array1 objectAtIndex:0];
                if (auditionDic[@"url"] != nil && ![auditionDic[@"url"] isEqual:[NSNull null]]) {
                    self.url = auditionDic[@"url"];
                    self.size = auditionDic[@"size"];
                    self.type = auditionDic[@"type"];
                    self.duration = auditionDic[@"duration"];
                    self.bitrate = auditionDic[@"bitrate"];
                }
            }
            // 视频
            if ([dic objectForKey:@"mv_list"] !=  nil && ![[dic objectForKey:@"mv_list"] isEqual:[NSNull null]]) {
                NSArray *array2 = [dic objectForKey:@"mv_list"];
                if (array2.count > 0) {
                    NSDictionary *mvDic = [array2 objectAtIndex:0];
                    self.mv_id = mvDic[@"id"];
                    self.mv_format = mvDic[@"format"];
                    self.mv_pic_url = mvDic[@"pic_url"];
                    self.mv_size = mvDic[@"size"];
                    self.mv_url = mvDic[@"url"];
                }
            }
            
        }
    }
    return self;
}


-(void)setValue:(id)value forKey:(NSString *)key
{
    if ([key isEqualToString:@""]) {
        
    }
}

-(id)valueForKeyUnderfinderKey:(NSString *)key
{
    return nil;
}

@end
